package br.com.financas.daos;

import br.com.financas.beans.TipoMovimentacao;
import br.com.financas.util.HibernateUtil;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Order;

/**
 *
 * @author Denis
 */
public class TipoMovimentacaoDao {
     Session sessao;
     Transaction trans;
     List<TipoMovimentacao> list;
     
    public List<TipoMovimentacao> getList(){  
        sessao = HibernateUtil.getSessionFactory().openSession();
        trans=sessao.beginTransaction();
        Criteria cri = sessao.createCriteria(TipoMovimentacao.class);
        cri.addOrder(Order.asc("descricao"));
        this.list = cri.list();
        sessao.close();
        return list;
    }
}